package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.core.domain.TreeEntityType;
import com.ruoyi.common.core.domain.vo.ListItemVo;
import com.ruoyi.common.core.domain.vo.QuestionsVo;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;

import java.util.ArrayList;
import java.util.List;

/**
 * 清单分类对象 list_type
 *
 * @author buxi
 * @date 2023-11-04
 */
@Data
public class ListType extends TreeEntityType {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;

    /**
     * 类型编码
     */
    @Excel(name = "类型编码")
    private String typeNo;

    /**
     * 分类名称
     */
    @Excel(name = "分类名称")
    private String typeName;

    /**
     * 分类状态（0正常 1停用）
     */
    @Excel(name = "分类状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    private Integer level = 0;

    /**
     * 子部门
     */
    private List<ListType> children = new ArrayList<>();
    private List<QuestionsVo> questionChildren = new ArrayList<>();

    private List<ListItemVo> listItemVos = new ArrayList<>();

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setTypeNo(String typeNo) {
        this.typeNo = typeNo;
    }

    public String getTypeNo() {
        return typeNo;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getDelFlag() {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("parentId", getParentId())
                .append("ancestors", getAncestors())
                .append("typeNo", getTypeNo())
                .append("typeName", getTypeName())
                .append("orderNum", getOrderNum())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
